<template>
    <div class="card-box">
        <el-row class="mb20">
            <el-col :md="20">
                <el-form :inline="true" class="demo-form-inline">
                    <el-button type="primary" @click="dialogVisible = true">刷选</el-button>
                    <el-button type="primary">
                        <i class="el-icon-refresh"></i>
                    </el-button>
                </el-form>
                <el-dialog :title="title + '筛选'" :visible.sync="dialogVisible" width="40%">
                    <el-form :model="ruleForm" ref="ruleForm" label-width="150px" class="demo-ruleForm">
                        <el-form-item label="用户名：" prop="name">
                            <el-input v-model="ruleForm.name" auto-complete="off"></el-input>
                        </el-form-item>
                        <el-form-item label="有效性：" prop="type">
                            <el-radio-group v-model="ruleForm.youxiao">
                                <el-radio :label="1">有效</el-radio>
                                <el-radio :label="2">无效</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="销售人民：" prop="value1">
                            <el-select v-model="ruleForm.value1" filterable placeholder="请选择" class="w100">
                                <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="分销商：" prop="value2">
                            <el-select v-model="ruleForm.value2" filterable placeholder="请选择" class="w100">
                                <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <span slot="footer" class="dialog-footer">
                        <el-button @click="dialogVisible = false">取 消</el-button>
                        <el-button type="primary" @click="selectCarrier">查询</el-button>
                    </span>
                </el-dialog>
            </el-col>
            <el-col :md="4" class="float-right">
            <router-link to="/team/new">
                <el-button type="primary">新增</el-button>
            </router-link>
            </el-col>
      </el-row>
      <el-table :data="tableData" stripe border style="width: 100%">
        <el-table-column prop="name" label="团队名" width="160">
        </el-table-column>
        <el-table-column prop="chinese_name" label="负责人" width="120">
        </el-table-column>
        <el-table-column prop="team_num" label="团队人数" width="120">
        </el-table-column>
        <el-table-column prop="carrier_num" label="负责分销商数" width="120">
        </el-table-column>
        <el-table-column prop="is_youxiao" label="有效性" width="120">
        </el-table-column>
        <el-table-column prop="created_time" label="创建时间" width="160">
        </el-table-column>
        <el-table-column prop="methods" label="操作" width="200">
          <template slot-scope="scope">
              <el-button size="mini" @click="editSingData(scope.row)">编辑</el-button>
              <el-button size="mini" type="primary" @click="deleteSingData(scope.row)">失效</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                dialogVisible: false,
                ruleForm: {
                    name: '',
                    youxiao: 1,
                    vlaue1: '',
                    value2: '',
                },
                title: '管理员',
                options1: [
                    {
                        value: '选线1',
                        label: '上海众创'
                    }
                ],
                options2: [
                    {
                        value: '选线1',
                        label: '软软'
                    }
                ],
                tableData: [
                    {
                        id: 1,
                        name: 'admin',
                        chinese_name: '管理员',
                        team_num: '5',
                        carrier_num: '13',
                        is_youxiao: '有效',
                        created_time: '2018-05-23 18:09:56'
                    }
                ]
            }
        },
        methods: {
            editSingData() {
                this.$router.push({
                    path: `/team/edit`
                })
            }
        }
    }
</script>

<style scoped lang="scss">
    .w100 {
        width: 100%;
    }
</style>